
********************************************************************************
**** Covid-19 Crisis and Hostility against Foreigners 
**** Tests in Text
*******************************************************************************

log using "$logpath/05_tests_in_text", replace

**************************************************************************************************
**** Tests in text
***************************************************************************************************

***************************************************************************************************

use "$cleandatapath/covid_fuels_hostility_clean_long.dta", clear

/*Jana: Probably OLD, {these are all in Table 1, right? 

*outgroup bias DOMESTIC FOREIGN
ttest HHT if (type_index=="DOMESTIC" | type_index=="FOREIGN") , by(outgroup)
somersd HHT outgroup if (type_index=="DOMESTIC"| type_index=="FOREIGN"), cluster(respondentId)
esize twosample HHT if (type_index=="DOMESTIC" | type_index=="FOREIGN") , by(outgroup) cohensd

*outgroup bias DOMESTIC ingroup vs. DOMESTIC outgroup
ttest HHT if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), by(outgroup)
somersd HHT outgroup if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), cluster(respondentId)
esize twosample HHT if (type_index=="DOMESTIC ingroup" | type_index=="DOMESTIC outgroup"), by(outgroup) cohensd

* DOMESTIC outgroup by COVID-19 condition
ttest HHT if (type_index=="DOMESTIC outgroup"), by(covid_prime)
somersd HHT covid_prime if (type_index=="DOMESTIC outgroup"), cluster(respondentId)
esize twosample HHT if (type_index=="DOMESTIC outgroup"), by(covid_prime) cohensd
}
*/

*Domestic vs. Domestic ingroup (CONTROL)
encode type_index, generate(type_index_num)
ttest HHT if (type_index=="DOMESTIC" | type_index=="DOMESTIC ingroup") & !covid_prime, by(type_index_num)
somersd HHT type_index_num if (type_index=="DOMESTIC" | type_index=="DOMESTIC ingroup") & !covid_prime, cluster(respondentId)

*Domestic vs. Domestic outgroup (CONTROL)
ttest HHT if (type_index=="DOMESTIC" | type_index=="DOMESTIC outgroup") & !covid_prime, by(type_index_num)
somersd HHT type_index_num if (type_index=="DOMESTIC" | type_index=="DOMESTIC outgroup") & !covid_prime, cluster(respondentId)

log close
